<?php 
  /**
   * @author EVANDRO DE OLIVEIRA.
   * @category TEMPLATE
   * @package TEMPLATES/SCRIPTS.
   * @since 17/03/2012.
   * @last_update 24/03/2012.
   * @copyright 2012.
   * @version 1.0.
   *
   */
  echo $this->doctype('XHTML1_TRANSITIONAL'); 
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title><?php echo Zend_Registry::getInstance()->config->system->title?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta http-equiv="Content-Style-Type" content="text/css"/>
    
    <?php 
      $browser = explode(';', $_SERVER['HTTP_USER_AGENT']);
      $browser = explode(' ', $browser[1]);
      
      if($browser[1]=='MSIE'){
      	?>
        <link href="<?php echo $this->css?>template/template_ie.css" rel="stylesheet" type="text/css"/>
        <?php	
      }
      else{
        ?>
        <link href="<?php echo $this->css?>template/template.css" rel="stylesheet" type="text/css"/> 
        <?php
      }   	
    ?>
    <link href="<?php echo $this->css?>template/menu.css" rel="stylesheet" type="text/css"/>  
    <link type="text/css" href="<?php echo $this->js?>/jquery/jquery.ui.all.css" rel="stylesheet" />
    <script type="text/javascript" src="<?php echo $this->js?>/jquery/jquery-1.4.2.js"></script>
    <script type="text/javascript" src="<?php echo $this->js?>/jquery/jquery.ui.core.js"></script>
    <script type="text/javascript" src="<?php echo $this->js?>/jquery/jquery.ui.widget.js"></script>
    <script type="text/javascript" src="<?php echo $this->js?>/jquery/jquery.ui.position.js"></script>
    <script type="text/javascript" src="<?php echo $this->js?>/jquery/jquery.ui.datepicker.js"></script>
    <script type="text/javascript" src="<?php echo $this->js?>/jquery/jquery.ui.datepicker-pt-BR.js"></script>
    
    <script type="text/javascript" src="<?php echo $this->js?>/jquery-autocomplete/lib/jquery.bgiframe.min.js"></script>
    <script type="text/javascript" src="<?php echo $this->js?>/jquery-autocomplete/lib/jquery.ajaxQueue.js"></script>
    <script type="text/javascript" src="<?php echo $this->js?>/jquery-autocomplete/lib/thickbox-compressed.js"></script>
    <script type="text/javascript" src="<?php echo $this->js?>/jquery-autocomplete/jquery.autocomplete.js"></script>
    
    <!--
    <link href="<?php echo $this->js?>/jquery-autocomplete/jquery.autocomplete.css" rel="stylesheet" type="text/css"/>
    <link href="<?php echo $this->js?>/jquery-autocomplete/lib/thickbox.css" rel="stylesheet" type="text/css"/>
    -->
    <script src="<?php echo $this->js?>/jquery/jquery.maskedinput.js"></script>
    
    <script type="text/javascript">
      $(function() {
        //$("#dt_insercao").datepicker();
        //$("#dt_alteracao").datepicker();
      });
    </script>
    <!-- 
      Char map das mascaras deve seguir o seguinte padrão:
      - Somente numérico: 9;
      - Somente letras: a;
      - Letras e números: x;
    -->
    <script type="text/javascript">
      jQuery(function($){
        //$("#dt_insercao").mask("99/99/9999");
        //$("#dt_alteracao").mask("99/99/9999");
        $("#dt_nascimento").mask("99/99/9999");
        $("#ds_cpf").mask("999.999.999-99");
        $("#ds_cep").mask("99.999-999");
        $("#ds_cel").mask("(99) 9999-9999");
        $("#ds_fone").mask("(99) 9999-9999");
        $("#ds_cnpj").mask("99.999.999/9999-99");
      });
    </script>
    
    <script language="JavaScript">
      window.onload = function(){
        if(screen.width == 640 || screen.height == 480){
        	document.getElementById("tb_content").style.height = "200px";
        }
        else if(screen.width == 800 || screen.height == 600){ 
          document.getElementById("tb_content").style.height = "368px";   
        }
        else if(screen.width == 1024 || screen.height == 768){
    		  document.getElementById("tb_content").style.height = "536px";
        }
        else if(screen.width == 1152 || screen.height == 864){
          document.getElementById("tb_content").style.height = "704px";  
        }
        else{ 
        	document.getElementById("tb_content").style.height = "536px";  
        }	
    	};  
    </script>
  </head>
  <body marginheight="0" marginwidth="0">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td class="title">
                <img src="<?php echo $this->imagens?>/template/tit_sem.png" alt="" width="350" height="60" border="0"/>
              </td>
            </tr>
          </table>
          
          <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr valign="top">
              <td class="bar-menu">
                <div class="margin-menu">
                  <div id="header">
                    <div>
                      <?php 
		                    if(Zend_Auth::getInstance()->hasIdentity() && Zend_Auth::getInstance()->getIdentity()->st_funcionario == 1){
		                      $this->menu();
		                    }
		                  ?>
		                  <div class="welcome">
		                    Seja Bem Vindo, <?php echo Zend_Auth::getInstance()->getIdentity()->ds_nome ?>
	                    </div>
                    </div>
                  </div>
                </div>
              </td>
            </tr>
          </table>
        </td>
      </tr>
      
      <tr>
        <td class="td_39">
          <table border="0" align="center" cellpadding="0" cellspacing="0" width="100%">
            <tr>
              <td id="tb_content" style="vertical-align:top;">
                <? echo $this->layout()->content ?>
              </td>
            </tr>
          </table>
        </td>
      </tr>
      <?php $this->footer();?>
    </table>
  </body>
</html>